<?php ?>

<table>
    <tr>
        <td colspan="2" align="right">
            <?php // echo CHtml::link("<b>Add To Cart</b>", array("site/addtocart", "add2cart" => $book->productId)); ?>
            <?php echo CHtml::link( CHtml::image( Yii::app()->baseUrl . "/images/add-cart.gif" , "", array()), array("site/addtocart", "add2cart" => $book->productId)); ?>
        </td>
    </tr>
    <td style="padding-top:7px; padding-left:3px" align="center" valign="top" width="1%">
        <img id="Image1" src="<?php echo Yii::app()->request->baseUrl . "/uploads/products/big/" . $book->bigImgUrl; ?>" style="height:180px;width:140px;border-width:0px;">
    </td>
    <td align="left" valign="top" width="99%">
        <table cellpadding="1" cellspacing="1" width="100%">
            <tbody><tr>
                    <td colspan="2" style="padding-top:-5" align="left" valign="top">
                        <span id="lblname" style="color:LightSalmon;font-family:Arial;font-size:10pt;font-weight:bold;"><?php echo $book->name; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px" align="left">
                        <strong>Author</strong>
                    </td>
                    <td align="left">
                        <span id="lblthoigian" style="display:inline-block;width:150px;"><?php echo $book->author; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px" align="left">

                        <strong>Hard Cover</strong>

                    </td>
                    <td align="left">
                        <span id="lbldaodien" style="display:inline-block;width:150px;"><?php echo $book->hardCover; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px; height: 17px;" align="left">

                        <strong>Price</strong>

                    </td>
                    <td style="height: 17px" align="left">
                        <span id="lbldienvien" style="display:inline-block;width:150px;"><?php echo $book->price . Yii::app()->params['currency']; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px; height: 17px;" align="left">

                        <strong>In Stock</strong>

                    </td>
                    <td style="height: 17px" align="left">
                        <span id="lbldienvien" style="display:inline-block;width:150px;"><?php echo $book->quantity; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        <div style="font-weight:bold">
                            Language
                        </div>
                    </td>
                    <td>
                        <span id="lblnuocsanxuat" style="display:inline-block;width:150px;"><?php echo $book->language; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        <div style="font-weight:bold">
                            Publisher
                        </div>
                    </td>
                    <td>
                        <span id="lblnuocsanxuat" style="display:inline-block;width:150px;"><?php echo $book->publisher; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        <div style="font-weight:bold">
                            Publication Date
                        </div>
                    </td>
                    <td>
                        <span id="lblnuocsanxuat" style="display:inline-block;width:150px;"><?php echo $book->publicationDate; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        <div style="font-weight:bold">
                            Dimension
                        </div>
                    </td>
                    <td>
                        <span id="lblnuocsanxuat" style="display:inline-block;width:150px;"><?php echo $book->dimensions; ?></span></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        <div style="font-weight:bold">
                            Genre
                        </div>
                    </td>
                    <td>
                        <span id="lbltheloai" style="display:inline-block;width:150px;">
                            <?php echo Helper::getProductCategoryNameById($book->productCategoryId); ?>
                        </span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="height: 17px" align="left">
                        <strong></strong>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="left">
                        <p style="width:100%">
                            <span style="font-weight:bold"><?php echo "Description"; ?></span>
                            <br/>
                            <?php echo $book->description; ?>
                        </p>
                    </td>
                </tr>
            </tbody>
        </table>
    </td>

</table>
<div align="center">
    <?php
//    foreach ($bookCollection as $coll) {
//        echo CHtml::image(Yii::app()->request->baseUrl . "/Uploads/imageCollection/" . $coll->source, $coll->alt_name, array("width" => "400px", "height" => "269px"));
//        echo "<br /><br /><br />";
//    }
    ?>
</div>   

<div id="comment">
    <?php if ( count($book->comments) > 0 ||   isset($book->commentCount) && $book->commentCount >= 1): ?>
        <h3>
            <?php echo ( count($book->comments) > 1 ) ? count($book->comments) . '
comments' : 'One comment'; ?>
        </h3>

        <?php
        $this->renderPartial('_comments', array(
            'post' => $book,
            'comments' => $book->comments,
        ));
        ?>
    <?php endif; ?>

    <?php
    if (!Yii::app()->user->isGuest)
        $this->renderPartial('_comment', array(
            'model' => $comment,
        ));
    ?>
</div>